﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;

namespace IssueIT.WebUI.Infrastructure.Helpers
{
    public static class ConfigHelper
    {
        public static T GetSetting<T>(string key)
        {
            return ElementReader.GetElement<T>(WebConfigurationManager.AppSettings, key);
        }

        public static T GetSetting<T>(string key, T valueIfMissing)
        {
            return ElementReader.GetElement<T>(WebConfigurationManager.AppSettings, key, valueIfMissing);
        }

        public static bool Exist(string key)
        {
            return ElementReader.KeyExist(WebConfigurationManager.AppSettings, key, ElementReader.ErrorBehavior.Ignore);
        }
    }
}